#include "dialog.h"
#include "ui_dialog.h"

dialog::dialog(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::dialog)
{
    ui->setupUi(this);
    lWno=new QLabel("员工编号:");
    leWno=new QLineEdit;

    lWname=new QLabel("员工名字");
    leWname=new QLineEdit;

    lWsex=new QLabel("员工性别");
    CWnsex=new QComboBox;
    CWnsex->addItem("男");
    CWnsex->addItem("女");


    lWdep=new QLabel("所属部门");
    TWp=new QTextEdit;

    lWage=new QLabel("员工年龄");
    leWage=new QLineEdit;


    //网格布局
    lLayout=new QGridLayout();

    lLayout->addWidget(lWno,0,0);
    lLayout->addWidget(leWno,0,1);

    lLayout->addWidget(lWname,1,0);
    lLayout->addWidget(leWname,1,1);

    lLayout->addWidget(lWsex,2,0);
    lLayout->addWidget(CWnsex,2,1);

    lLayout->addWidget(lWdep,3,0);
    lLayout->addWidget(TWp,3,1);

    lLayout->addWidget(lWage,4,0);
    lLayout->addWidget(leWage,4,1);

    lLayout->setColumnStretch(0,1);
    lLayout->setColumnStretch(1,3);

    //右边上部分
    toprightlayout=new QHBoxLayout;
    toprightlayout->setSpacing(25);

    MyselfInfo=new QLabel("个人简历:");
    MyselfInfoTextEdit=new QTextEdit;

    rightlayout=new QVBoxLayout;
    rightlayout->addLayout(toprightlayout);
    rightlayout->addWidget(MyselfInfo);
    rightlayout->addWidget(MyselfInfoTextEdit);

    okbutton=new QPushButton("确认");
    cancelbutton=new QPushButton("退出");

    buttomLayout=new QHBoxLayout;
    buttomLayout->addStretch();
    buttomLayout->addWidget(okbutton);
    buttomLayout->addWidget(cancelbutton);


    //栅格布局
    QGridLayout *mlayout=new QGridLayout(this);
//    mlayout->setSpacing(10);
    mlayout->setContentsMargins(10, 20, 30, 40);;
    mlayout->addLayout(lLayout,0,0);
    mlayout->addLayout(rightlayout,0,1);
    mlayout->addLayout(buttomLayout,1,0,1,2);





}

dialog::~dialog()
{
    delete ui;
}

